import 'package:flutter/material.dart';
import 'package:flutter_default_project/todo_list_model.dart';
import 'package:provider/provider.dart';

class StatView extends StatelessWidget {
  const StatView({super.key});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text('complete'),
          Selector<TodoListModel, int>(
            selector: (context, model) => model.numCompleted,
            builder: (context, count, child) {
              return Text('$count');
            },
          ),
        ],
      ),
    );
  }
}
